home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xml / ExternalGEDeclaration.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  2.9 KB  |  76 lines

  1. package com.extensibility.xml;
  2.  
  3. import com.extensibility.util.StringUtilities;
  4. import java.util.Vector;
  5.  
  6. public class ExternalGEDeclaration extends GeneralEntityDeclaration {
  7.    String notation;
  8.  
  9.    public ExternalGEDeclaration(String var1, String var2, URI var3) {
  10.       super(var1, var2, var3);
  11.    }
  12.  
  13.    public ExternalGEDeclaration(String var1, String var2, URI var3, String var4) {
  14.       this(var1, var2, var3);
  15.       this.notation = var4;
  16.    }
  17.  
  18.    public String getClassName() {
  19.       return "com.extensibility.xml.ExternalGEDeclaration";
  20.    }
  21.  
  22.    public boolean isPE() {
  23.       return false;
  24.    }
  25.  
  26.    public boolean isUnparsed() {
  27.       return this.notation != null;
  28.    }
  29.  
  30.    public String getNotation() {
  31.       return this.notation;
  32.    }
  33.  
  34.    public void setNotation(String var1) {
  35.       String var2 = this.notation;
  36.       this.notation = var1;
  37.       ((BaseDeclaration)this).fireChangeEvent(54, var2);
  38.    }
  39.  
  40.    public String getSource() {
  41.       StringBuffer var1 = new StringBuffer(String.valueOf(String.valueOf("<!ENTITY ").concat(String.valueOf(super.name))).concat(String.valueOf(" ")));
  42.       if (super.publicID != null) {
  43.          var1.append(String.valueOf(String.valueOf(String.valueOf("PUBLIC ").concat(String.valueOf(DTDUtilities.convertPEReferences(StringUtilities.doubleQuoted(super.publicID), true)))).concat(String.valueOf(" "))).concat(String.valueOf(DTDUtilities.convertPEReferences(StringUtilities.doubleQuoted(super.systemID == null ? null : super.systemID.toSource()), true))));
  44.       } else {
  45.          var1.append(String.valueOf("SYSTEM ").concat(String.valueOf(DTDUtilities.convertPEReferences(StringUtilities.doubleQuoted(super.systemID == null ? null : super.systemID.toSource()), true))));
  46.       }
  47.  
  48.       if (this.isUnparsed()) {
  49.          var1.append(String.valueOf("NDATA ").concat(String.valueOf(this.notation)));
  50.       }
  51.  
  52.       var1.append(String.valueOf(">").concat(String.valueOf(BaseDeclaration.LINE_SEPARATOR)));
  53.       return var1.toString();
  54.    }
  55.  
  56.    public Vector getPrerequisites(SchemaIntf var1) {
  57.       Vector var2 = super.getPrerequisites(var1);
  58.       if (this.isUnparsed()) {
  59.          NotationDeclaration var3 = (NotationDeclaration)var1.getNamedDeclaration(this.getNotation(), Class.forName("com.extensibility.xml.NotationDeclaration"));
  60.          if (var3 != null) {
  61.             var2.addElement(var3);
  62.          }
  63.       }
  64.  
  65.       return var2;
  66.    }
  67.  
  68.    public void checkForErrors(SchemaIntf var1) {
  69.       super.checkForErrors(var1);
  70.       if (this.notation != null && var1.getNamedDeclaration(this.notation, Class.forName("com.extensibility.xml.NotationDeclaration")) == null) {
  71.          super.errors.addElement(new ParserException(223, this.notation));
  72.       }
  73.  
  74.    }
  75. }
  76.